import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main2(String[] args) {
        MySingleList mySingleList = new MySingleList();
        mySingleList.addLast(1);
        mySingleList.addLast(2);
        mySingleList.addLast(1);
        mySingleList.addLast(4);
        mySingleList.addLast(1);
        mySingleList.display();
        //mySingleList.removeAllKey(1);
        mySingleList.remove(4);
        mySingleList.display();
    }

    public static void main(String[] args) {
        MyLinkedList myLinkedList =new MyLinkedList();
        myLinkedList.addLast(1);
        myLinkedList.addLast(1);
        myLinkedList.addLast(1);
        myLinkedList.addLast(1);
        myLinkedList.addLast(1);
        myLinkedList.display();
       /* myLinkedList.addIndex(0,88888);
        myLinkedList.display();*/
        /*myLinkedList.removeAllTheKey(1);
        myLinkedList.display();*/
        myLinkedList.clear();
        myLinkedList.display();
    }
    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNextLine()){
            String s = scan.nextLine();
            String result = "";
            String[] arr = s.split(" ");
            for (int i = arr.length-1; i >=0 ; i--) {
                result += arr[i] + " ";
            }
            System.out.println(result.trim());
        }
    }

    public static void main5(String[] args) {
        int arr[] = new int[4];
        Scanner scan = new Scanner(System.in);
        for (int i = 0; i < 4; i++) {
            arr[i] = scan.nextInt();
        }
        int A = (arr[0]+arr[2])/2;
        int B = (arr[1]+arr[3])/2;
        int C = B - arr[1];
        if((C == arr[3]-B)&& (B ==A-arr[0])){
            System.out.print(A+" "+B+" "+C);
        }else{
            System.out.print("No");
        }
    }

}
